package com.hmys.api.service.impl;

import com.hmys.api.mapper.WebExpoApplyMapper;
import com.hmys.api.model.WebExpoApply;
import com.hmys.api.service.WebExpoApplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.Date;

/**
 * Created by chen365 on 2018/03/28.
 */
@Service
public class WebExpoApplyServiceImpl implements WebExpoApplyService {
    @Autowired
    private WebExpoApplyMapper webExpoApplyMapper;

    @Override
    public int save(WebExpoApply record) {
        record.setCreateTime(new Date());
        record.setStatus(true);
        record.setIsView(false);
        if (record.getSource().isEmpty()) {
            record.setSource("官网");
        }
        return webExpoApplyMapper.insertSelective(record);
    }
}
